<style scoped>
	.goods_font {
		height: 32px;
		line-height: 32px;
	}
	
	.goods_right {
		float: right;
		margin-right: 20px;
	}
</style>

<template>
	<div>
		<div class="layout-breadcrumb">
			<Breadcrumb>
				<Breadcrumb-item href="#">首页</Breadcrumb-item>
				<Breadcrumb-item href="#">门店管理</Breadcrumb-item>
				<Breadcrumb-item>门店新增</Breadcrumb-item>
			</Breadcrumb>
		</div>
		<div class="layout-content">
			<div class="layout-content-main">
				<Row>
					<Col span="2" class="goods_font"><span class="goods_right">门店名称</span></Col>
					<Col span="22">
					<Input v-model="shopName" placeholder="请输入门店名称" style="width: 300px"></Input>
					</Col>
				</Row>
				<br>
				<Row>
					<Col span="7">
					<div class="f-r">
						<Button @click="cancel">取 消</Button>&nbsp;
						<Button type="primary" @click="update">保 存</Button>
					</div>
					</Col>
					<Col span="20">
					</Col>
				</Row>
			</div>
		</div>
	</div>
</template>

<script>
	export default {
		data() {
			return {
				shopName: ''
			}
		},
		methods: {
			cancel() {
				this.$router.push({
					path: '/tld/index/shop'
				});
			},
			update() {
				let _that = this;
				this.$tldJsonp({
					isLayer: true,
					url: this.$domain + "/tld/admin/shop/insert.json",
					params: {
						userId: window.localStorage["userId"],
						shopName: this.shopName
					},
					successFc: (response) => {
						this.$Message.success({
							content: '保存成功',
							onClose: function() {
								_that.$router.push({
									path: '/tld/index/shop'
								});
							}
						});
					}
				})
			}
		}
	}
</script>